﻿function ShowValidationEffect(ctrlId, ctrlValId)
{
    //alert('Hello');
    if(typeof(Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var Ctrl = document.getElementById(ctrlId);
    ValidatorValidate(valCtrl);
    
    if(valCtrl.isvalid == false)
    {
        //alert('Not Valid');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrl,false);
    }
    else if(Ctrl.value.length == 0)
    {
        AddRemoveCss(valCtrl,false);
        //ValidatorValidate(valCtrl);
    }
    else if(Ctrl.value == "-1")
    {
        AddRemoveCss(valCtrl,false);
        //ValidatorValidate(valCtrl);
    }
    else
    {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrl,true);
    }
}

function ShowValidationEffectMinusTwo(ctrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var Ctrl = document.getElementById(ctrlId);
    ValidatorValidate(valCtrl);

    if (valCtrl.isvalid == false) {
        //alert('Not Valid');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrl, false);
    }
    else if (Ctrl.value.length == 0) {
        AddRemoveCss(valCtrl, false);
        //ValidatorValidate(valCtrl);
    }
    else if (Ctrl.value == "-2") {
        AddRemoveCss(valCtrl, false);
        //ValidatorValidate(valCtrl);
    }
    else {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrl, true);
    }
}


function ShowValidationEffectNoRequire(ctrlId, ctrlValId)
{
    //alert('Hello');
    if(typeof(Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var Ctrl = document.getElementById(ctrlId);
    if(valCtrl.isvalid == false)
    {
        //alert('Not Valid');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrl,false);
    }
    else
    {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrl,true);
    }
}

function ShowValidationEffectTwo(ctrlId, ctrlValIdOne, ctrlValIdTwo)
{
    
    if(typeof(Page_Validators) == "undefined") return;
    var valCtrlOne = document.getElementById(ctrlValIdOne);
    var valCtrlTwo = document.getElementById(ctrlValIdTwo);
    var Ctrl = document.getElementById(ctrlId);
    //    alert('Hello');
        ValidatorValidate(valCtrlOne);
        ValidatorValidate(valCtrlTwo);
        //alert(valCtrlOne.isvalid);
        //alert(valCtrlTwo.isvalid);
    if(valCtrlOne.isvalid == false)
    {
        //alert('Not Valid One');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrlOne,false);
    }
    else if(valCtrlTwo.isvalid == false)
    {
        //alert('Not Valid Two');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrlTwo,false);
    }
    else if(Ctrl.value.length == 0)
    {
        AddRemoveCss(valCtrlOne,false);
        ValidatorValidate(valCtrlOne);
    }
    else
    {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrlOne,true);
        AddRemoveCss(valCtrlTwo,true);
    }
}

function ShowValidationEffectThree(ctrlId, ctrlValIdOne, ctrlValIdTwo, ctrlValIdThree)
{
    //alert('Hello');
    if(typeof(Page_Validators) == "undefined") return;
    var valCtrlOne = document.getElementById(ctrlValIdOne);
    var valCtrlTwo = document.getElementById(ctrlValIdTwo);
    var valCtrlThree = document.getElementById(ctrlValIdThree);
    var Ctrl = document.getElementById(ctrlId);
    //ValidatorValidate(valCtrlOne);
    //ValidatorValidate(valCtrlTwo);
    if(valCtrlOne.isvalid == false)
    {
        //alert('Not Valid One');
        AddRemoveCss(valCtrlOne,false);
        //Ctrl.className = 'validationError';
    }
    else if(valCtrlTwo.isvalid == false)
    {
        //alert('Not Valid Two');
        AddRemoveCss(valCtrlTwo,false);
        //Ctrl.className = 'validationError';
    }
    else if(valCtrlThree.isvalid == false)
    {
        //alert('Not Valid Three');
        AddRemoveCss(valCtrlThree,false);
        //Ctrl.className = 'validationError';
    }
    else if(Ctrl.value.length == 0)
    {
        AddRemoveCss(valCtrlOne,false);
    }
    else if(Ctrl.value == "-1")
    {
        AddRemoveCss(valCtrlOne,false);
    }
    else
    {
        //alert('Is Valid');
        AddRemoveCss(valCtrlOne,true);
        //Ctrl.className = 'noError';
    }
}

function AddRemoveCss(valctrl,flag1)
{
    var el = document.getElementById(valctrl.controltovalidate);
    if (el != null) {
        if (valctrl.validationErrorCssClass || (valctrl.validationErrorCssClass = valctrl.getAttribute("validationErrorCssClass"))) {
            var flag2 = el.className.indexOf(valctrl.validationErrorCssClass) != -1;
            if (flag1 && flag2) {
                el.className = el.className.replace(new RegExp("\\b" + valctrl.validationErrorCssClass + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
            }
            else if (!flag1 && !flag2) {
                el.className += (el.className.length != 0 ? " " : "") + valctrl.validationErrorCssClass;
            }
        }
    }
}

function AddRemoveCssTwo(ctrl, flag1)
{
    if(ctrl != null)
    {
        var flag2 = ctrl.className.indexOf("validationError") != -1;
        if(flag1 && flag2)
        {
            ctrl.className = ctrl.className.replace(new RegExp("\\b" + "validationError" + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
        }
        else if(!flag1 && !flag2)
        {
            ctrl.className += (ctrl.className.length != 0 ? " " : "") + "validationError";
        }
    }
}

function ShowValidationEffectDateCtrl(ddlDayId,ddlMonthId, ddlYearId, ctrlValId)
{
    //alert('Hello');
    if(typeof(Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrlDay = document.getElementById(ddlDayId);
    var ctrlMonth = document.getElementById(ddlMonthId);
    var ctrlYear = document.getElementById(ddlYearId);
    //ValidatorValidate(valCtrlOne);
    //ValidatorValidate(valCtrlTwo);
    if(valCtrl.isvalid == false)
    {
        //alert('Not Valid One');
        ctrlDay.className = 'validationError';
        ctrlMonth.className = 'validationError';
        ctrlYear.className = 'validationError';
    }
    else
    {
        //alert('Is Valid');
        ctrlDay.className = 'noError';
        ctrlMonth.className = 'noError';
        ctrlYear.className = 'noError';
    }
}

//function ShowValidationEffectOption(ctrlOptionOneId,ctrlOptionTwoId, txtCtrlId, ctrlValId)
//{
//    //alert('Hello');
//    if(typeof(Page_Validators) == "undefined") return;
//    var valCtrl = document.getElementById(ctrlValId);
//    var ctrlOptOne = document.getElementById(ctrlOptionOneId);
//    var ctrlOptTwo = document.getElementById(ctrlOptionTwoId);
//    var ctrlText = document.getElementById(txtCtrlId);
//    alert(ctrlText.value.length);
//    alert(valCtrl);
//    //ValidatorValidate(valCtrlOne);
//    //ValidatorValidate(valCtrlTwo);
//    //alert(valCtrl.isvalid);
//    if(valCtrl.isvalid == false)
//    {
//        //alert('Not Valid One');
//        //alert(ctrlOptOne);
//        AddRemoveCss(ctrlOptOne,false);
//        AddRemoveCss(ctrlOptTwo,false);
//        //ctrlOptOne.className = 'validationError';
//        //ctrlOptTwo.className = 'validationError';
//    }
//    else if(ctrlText.value.length == 0)
//    {
//        //AddRemoveCss(ctrlOptOne,false);
//        //AddRemoveCss(ctrlOptTwo,false);
//        alert("value zero");
//        ctrlOptOne.className = 'validationError';
//        ctrlOptTwo.className = 'validationError';
//        
//        ValidatorValidate(valCtrl);
//    }
//    else
//    {
//        //alert('Is Valid');
//        AddRemoveCss(ctrlOptOne,true);
//        AddRemoveCss(ctrlOptTwo,true);
//        //ctrlOptOne.className = 'noError';
//        //ctrlOptTwo.className = 'noError';
//    }
//}

function ShowValidationEffectOption(divCtrlYesId, divCtrlNoId, txtCtrlId, ctrlValId)
{
    //alert('Hello');
    if(typeof(Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrlYesDiv = document.getElementById(divCtrlYesId);
    var ctrlNoDiv = document.getElementById(divCtrlNoId);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if(valCtrl.isvalid == false)
    {
       AddRemoveCssTwo(ctrlYesDiv,false);
       AddRemoveCssTwo(ctrlNoDiv,false);
    }
    else if(ctrlText.value.length == 0)
    {
        AddRemoveCssTwo(ctrlYesDiv,false);
        AddRemoveCssTwo(ctrlNoDiv,false);
        ValidatorValidate(valCtrl);
    }
    else
    {
       AddRemoveCssTwo(ctrlYesDiv,true);
       AddRemoveCssTwo(ctrlNoDiv,true);
       ValidatorValidate(valCtrl);
    }
    
    //alert(ctrlText.value.length);
    //alert(valCtrl);
    //ValidatorValidate(valCtrlOne);
    //ValidatorValidate(valCtrlTwo);
    //alert(valCtrl.isvalid);
}



function ShowValidationEffectOptionThree(divCtrl1Id, divCtrl2Id, divCtrl3Id, txtCtrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrl1Div = document.getElementById(divCtrl1Id);
    var ctrl2Div = document.getElementById(divCtrl2Id);
    var ctrl3Div = document.getElementById(divCtrl3Id);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if (valCtrl.isvalid == false) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
    }
    else if (ctrlText.value.length == 0) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        ValidatorValidate(valCtrl);
    }
    else {
        AddRemoveCssTwo(ctrl1Div, true);
        AddRemoveCssTwo(ctrl2Div, true);
        AddRemoveCssTwo(ctrl3Div, true);
        ValidatorValidate(valCtrl);
    }
}


function ShowValidationEffectOptionFour(divCtrl1Id, divCtrl2Id, divCtrl3Id, divCtrl4Id, txtCtrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrl1Div = document.getElementById(divCtrl1Id);
    var ctrl2Div = document.getElementById(divCtrl2Id);
    var ctrl3Div = document.getElementById(divCtrl3Id);
    var ctrl4Div = document.getElementById(divCtrl4Id);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if (valCtrl.isvalid == false) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        AddRemoveCssTwo(ctrl4Div, false);
    }
    else if (ctrlText.value.length == 0) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        AddRemoveCssTwo(ctrl4Div, false);
        ValidatorValidate(valCtrl);
    }
    else {
        AddRemoveCssTwo(ctrl1Div, true);
        AddRemoveCssTwo(ctrl2Div, true);
        AddRemoveCssTwo(ctrl3Div, true);
        AddRemoveCssTwo(ctrl4Div, true);
        ValidatorValidate(valCtrl);
    }
}

function ShowValidationEffect(ctrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var Ctrl = document.getElementById(ctrlId);
    ValidatorValidate(valCtrl);

    if (valCtrl.isvalid == false) {
        //alert('Not Valid');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrl, false);
    }
    else if (Ctrl.value.length == 0) {
        AddRemoveCss(valCtrl, false);
        //ValidatorValidate(valCtrl);
    }
    else if (Ctrl.value == "-1") {
        AddRemoveCss(valCtrl, false);
        //ValidatorValidate(valCtrl);
    }
    else {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrl, true);
    }
}

function ShowValidationEffectMinusTwo(ctrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var Ctrl = document.getElementById(ctrlId);
    ValidatorValidate(valCtrl);

    if (valCtrl.isvalid == false) {
        //alert('Not Valid');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrl, false);
    }
    else if (Ctrl.value.length == 0) {
        AddRemoveCss(valCtrl, false);
        //ValidatorValidate(valCtrl);
    }
    else if (Ctrl.value == "-2") {
        AddRemoveCss(valCtrl, false);
        //ValidatorValidate(valCtrl);
    }
    else {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrl, true);
    }
}


function ShowValidationEffectNoRequire(ctrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var Ctrl = document.getElementById(ctrlId);
    if (valCtrl.isvalid == false) {
        //alert('Not Valid');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrl, false);
    }
    else {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrl, true);
    }
}

function ShowValidationEffectTwo(ctrlId, ctrlValIdOne, ctrlValIdTwo) {

    if (typeof (Page_Validators) == "undefined") return;
    var valCtrlOne = document.getElementById(ctrlValIdOne);
    var valCtrlTwo = document.getElementById(ctrlValIdTwo);
    var Ctrl = document.getElementById(ctrlId);
    //    alert('Hello');
    ValidatorValidate(valCtrlOne);
    ValidatorValidate(valCtrlTwo);
    //alert(valCtrlOne.isvalid);
    //alert(valCtrlTwo.isvalid);
    if (valCtrlOne.isvalid == false) {
        //alert('Not Valid One');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrlOne, false);
    }
    else if (valCtrlTwo.isvalid == false) {
        //alert('Not Valid Two');
        //Ctrl.className = 'validationError';
        AddRemoveCss(valCtrlTwo, false);
    }
    else if (Ctrl.value.length == 0) {
        AddRemoveCss(valCtrlOne, false);
        ValidatorValidate(valCtrlOne);
    }
    else {
        //alert('Is Valid');
        //Ctrl.className = 'noError';
        AddRemoveCss(valCtrlOne, true);
        AddRemoveCss(valCtrlTwo, true);
    }
}

function ShowValidationEffectThree(ctrlId, ctrlValIdOne, ctrlValIdTwo, ctrlValIdThree) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrlOne = document.getElementById(ctrlValIdOne);
    var valCtrlTwo = document.getElementById(ctrlValIdTwo);
    var valCtrlThree = document.getElementById(ctrlValIdThree);
    var Ctrl = document.getElementById(ctrlId);
    //ValidatorValidate(valCtrlOne);
    //ValidatorValidate(valCtrlTwo);
    if (valCtrlOne.isvalid == false) {
        //alert('Not Valid One');
        AddRemoveCss(valCtrlOne, false);
        //Ctrl.className = 'validationError';
    }
    else if (valCtrlTwo.isvalid == false) {
        //alert('Not Valid Two');
        AddRemoveCss(valCtrlTwo, false);
        //Ctrl.className = 'validationError';
    }
    else if (valCtrlThree.isvalid == false) {
        //alert('Not Valid Three');
        AddRemoveCss(valCtrlThree, false);
        //Ctrl.className = 'validationError';
    }
    else if (Ctrl.value.length == 0) {
        AddRemoveCss(valCtrlOne, false);
    }
    else if (Ctrl.value == "-1") {
        AddRemoveCss(valCtrlOne, false);
    }
    else {
        //alert('Is Valid');
        AddRemoveCss(valCtrlOne, true);
        //Ctrl.className = 'noError';
    }
}

function AddRemoveCss(valctrl, flag1) {
    var el = document.getElementById(valctrl.controltovalidate);
    //alert(el);
    if (el != null) {

        var flag2 = el.className.indexOf("validationError") != -1;
        if (flag1 && flag2) {
            //alert("1 and 2");
            el.className = el.className.replace(new RegExp("\\b" + "validationError" + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
        }
        else if (!flag1 && !flag2) {
        //alert("not both");
            el.className += (el.className.length != 0 ? " " : "") + "validationError";
        }

        /*if (valctrl.validationErrorCssClass || (valctrl.validationErrorCssClass = valctrl.getAttribute("validationErrorCssClass"))) {
        var flag2 = el.className.indexOf(valctrl.validationErrorCssClass) != -1;
        if (flag1 && flag2) {
        el.className = el.className.replace(new RegExp("\\b" + valctrl.validationErrorCssClass + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
        }
        else if (!flag1 && !flag2) {
        el.className += (el.className.length != 0 ? " " : "") + valctrl.validationErrorCssClass;
        }
        }*/
    }
}

function AddRemoveCssTwo(ctrl, flag1) {
    if (ctrl != null) {
        var flag2 = ctrl.className.indexOf("validationError") != -1;
        if (flag1 && flag2) {
            ctrl.className = ctrl.className.replace(new RegExp("\\b" + "validationError" + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
        }
        else if (!flag1 && !flag2) {
            ctrl.className += (ctrl.className.length != 0 ? " " : "") + "validationError";
        }
    }
}

function ShowValidationEffectDateCtrl(ddlDayId, ddlMonthId, ddlYearId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrlDay = document.getElementById(ddlDayId);
    var ctrlMonth = document.getElementById(ddlMonthId);
    var ctrlYear = document.getElementById(ddlYearId);
    //ValidatorValidate(valCtrlOne);
    //ValidatorValidate(valCtrlTwo);
    if (valCtrl.isvalid == false) {
        //alert('Not Valid One');
        ctrlDay.className = 'validationError';
        ctrlMonth.className = 'validationError';
        ctrlYear.className = 'validationError';
    }
    else {
        //alert('Is Valid');
        ctrlDay.className = 'noError';
        ctrlMonth.className = 'noError';
        ctrlYear.className = 'noError';
    }
}

//function ShowValidationEffectOption(ctrlOptionOneId,ctrlOptionTwoId, txtCtrlId, ctrlValId)
//{
//    //alert('Hello');
//    if(typeof(Page_Validators) == "undefined") return;
//    var valCtrl = document.getElementById(ctrlValId);
//    var ctrlOptOne = document.getElementById(ctrlOptionOneId);
//    var ctrlOptTwo = document.getElementById(ctrlOptionTwoId);
//    var ctrlText = document.getElementById(txtCtrlId);
//    alert(ctrlText.value.length);
//    alert(valCtrl);
//    //ValidatorValidate(valCtrlOne);
//    //ValidatorValidate(valCtrlTwo);
//    //alert(valCtrl.isvalid);
//    if(valCtrl.isvalid == false)
//    {
//        //alert('Not Valid One');
//        //alert(ctrlOptOne);
//        AddRemoveCss(ctrlOptOne,false);
//        AddRemoveCss(ctrlOptTwo,false);
//        //ctrlOptOne.className = 'validationError';
//        //ctrlOptTwo.className = 'validationError';
//    }
//    else if(ctrlText.value.length == 0)
//    {
//        //AddRemoveCss(ctrlOptOne,false);
//        //AddRemoveCss(ctrlOptTwo,false);
//        alert("value zero");
//        ctrlOptOne.className = 'validationError';
//        ctrlOptTwo.className = 'validationError';
//        
//        ValidatorValidate(valCtrl);
//    }
//    else
//    {
//        //alert('Is Valid');
//        AddRemoveCss(ctrlOptOne,true);
//        AddRemoveCss(ctrlOptTwo,true);
//        //ctrlOptOne.className = 'noError';
//        //ctrlOptTwo.className = 'noError';
//    }
//}

function ShowValidationEffectOption(divCtrlYesId, divCtrlNoId, txtCtrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrlYesDiv = document.getElementById(divCtrlYesId);
    var ctrlNoDiv = document.getElementById(divCtrlNoId);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if (valCtrl.isvalid == false) {
        AddRemoveCssTwo(ctrlYesDiv, false);
        AddRemoveCssTwo(ctrlNoDiv, false);
    }
    else if (ctrlText.value.length == 0) {
        AddRemoveCssTwo(ctrlYesDiv, false);
        AddRemoveCssTwo(ctrlNoDiv, false);
        ValidatorValidate(valCtrl);
    }
    else {
        AddRemoveCssTwo(ctrlYesDiv, true);
        AddRemoveCssTwo(ctrlNoDiv, true);
        ValidatorValidate(valCtrl);
    }

    //alert(ctrlText.value.length);
    //alert(valCtrl);
    //ValidatorValidate(valCtrlOne);
    //ValidatorValidate(valCtrlTwo);
    //alert(valCtrl.isvalid);
}



function ShowValidationEffectOptionThree(divCtrl1Id, divCtrl2Id, divCtrl3Id, txtCtrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrl1Div = document.getElementById(divCtrl1Id);
    var ctrl2Div = document.getElementById(divCtrl2Id);
    var ctrl3Div = document.getElementById(divCtrl3Id);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if (valCtrl.isvalid == false) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
    }
    else if (ctrlText.value.length == 0) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        ValidatorValidate(valCtrl);
    }
    else {
        AddRemoveCssTwo(ctrl1Div, true);
        AddRemoveCssTwo(ctrl2Div, true);
        AddRemoveCssTwo(ctrl3Div, true);
        ValidatorValidate(valCtrl);
    }
}


function ShowValidationEffectOptionFour(divCtrl1Id, divCtrl2Id, divCtrl3Id, divCtrl4Id, txtCtrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrl1Div = document.getElementById(divCtrl1Id);
    var ctrl2Div = document.getElementById(divCtrl2Id);
    var ctrl3Div = document.getElementById(divCtrl3Id);
    var ctrl4Div = document.getElementById(divCtrl4Id);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if (valCtrl.isvalid == false) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        AddRemoveCssTwo(ctrl4Div, false);
    }
    else if (ctrlText.value.length == 0) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        AddRemoveCssTwo(ctrl4Div, false);
        ValidatorValidate(valCtrl);
    }
    else {
        AddRemoveCssTwo(ctrl1Div, true);
        AddRemoveCssTwo(ctrl2Div, true);
        AddRemoveCssTwo(ctrl3Div, true);
        AddRemoveCssTwo(ctrl4Div, true);
        ValidatorValidate(valCtrl);
    }
}

function ShowValidationEffectOptionFive(divCtrl1Id, divCtrl2Id, divCtrl3Id, divCtrl4Id, divCtrl5Id, txtCtrlId, ctrlValId) {
    //alert('Hello');
    if (typeof (Page_Validators) == "undefined") return;
    var valCtrl = document.getElementById(ctrlValId);
    var ctrl1Div = document.getElementById(divCtrl1Id);
    var ctrl2Div = document.getElementById(divCtrl2Id);
    var ctrl3Div = document.getElementById(divCtrl3Id);
    var ctrl4Div = document.getElementById(divCtrl4Id);
    var ctrl5Div = document.getElementById(divCtrl5Id);
    var ctrlText = document.getElementById(txtCtrlId);
    ValidatorValidate(valCtrl);
    if (valCtrl.isvalid == false) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        AddRemoveCssTwo(ctrl4Div, false);
        AddRemoveCssTwo(ctrl5Div, false);
    }
    else if (ctrlText.value.length == 0) {
        AddRemoveCssTwo(ctrl1Div, false);
        AddRemoveCssTwo(ctrl2Div, false);
        AddRemoveCssTwo(ctrl3Div, false);
        AddRemoveCssTwo(ctrl4Div, false);
        AddRemoveCssTwo(ctrl5Div, false);
        ValidatorValidate(valCtrl);
    }
    else {
        AddRemoveCssTwo(ctrl1Div, true);
        AddRemoveCssTwo(ctrl2Div, true);
        AddRemoveCssTwo(ctrl3Div, true);
        AddRemoveCssTwo(ctrl4Div, true);
        AddRemoveCssTwo(ctrl5Div, true);
        ValidatorValidate(valCtrl);
    }
}

var IsLoadValidationError;
function LoadValidationErrorCss()
{
    if(IsLoadValidationError != null && IsLoadValidationError == true) return IsLoadValidationError;
    //Checking if ValidatorValidate exists
    //alert('Loaded');
    IsLoadValidationError = true;
    if (typeof (ValidatorValidate) != "undefined") {
        //Copy ValidatorValidate to BaseValidatorValidate
        BaseValidatorValidate = ValidatorValidate;
        //alert('validationerror 1');
        //Used to remeber the current activated validationGroup
        _lastValidationGroup = null;

        //Replacing ValidatorValidate
        ValidatorValidate = function(val, validationGroup, event) {
        //Calling original ValidatorValidate function saved in BaseValidatorValidate
           // alert('validationerror 2');
            BaseValidatorValidate(val, validationGroup, event);
            
            //Remembering the current validationGroup
            if (validationGroup != null) _lastValidationGroup = validationGroup;
            
            //Seting valid all the validations not in the current validationGroup
            if ((typeof (val.validationGroup) == "undefined" && _lastValidationGroup != "") || (typeof (val.validationGroup) != "undefined" && val.validationGroup != _lastValidationGroup)) val.isvalid = true;

            //***** To View Error Message *****//
            //Sophon 26 May 2011
            val.errormessage = val.id.toString() + " " + validationGroup;
            //***********************************
            //alert('validationerror 3');
            //If a validationErrorCssClass is defined ...
            if (val.validationErrorCssClass || (val.validationErrorCssClass = val.getAttribute("validationErrorCssClass"))) {
                //Checking if all validators on the same controltovalidate with the same validationGroup are valid
                var flag1 = val.isvalid;
                for (var num1 = 0; num1 < Page_Validators.length; num1++) {
                    var val2 = Page_Validators[num1];
                    if (val2.controltovalidate == val.controltovalidate && (validationGroup == null || typeof (val2.validationGroup) == "undefined" || val2.validationGroup == validationGroup)) flag1 &= val2.isvalid;
                }

                //Adding or removing validationErrorCssClass from controltovalidate
                if (typeof ($get) != "undefined") {
                    //Do it with ASP.NET ajax functions
                    Sys.UI.DomElement[flag1 ? 'removeCssClass' : 'addCssClass']($get(val.controltovalidate), val.validationErrorCssClass);
                }
                else {
                    //Do it with standard javascript without ajax functions
                    var el = document.getElementById(val.controltovalidate);
                    if (el != null) {
                        var flag2 = el.className.indexOf(val.validationErrorCssClass) != -1;
                        if (flag1 && flag2) {
                            el.className = el.className.replace(new RegExp("\\b" + val.validationErrorCssClass + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
                        }
                        else if (!flag1 && !flag2) {
                            el.className += (el.className.length != 0 ? " " : "") + val.validationErrorCssClass;
                        }
                    }
                }
            }

            //Refreshing ValidationSummary
            /*if (typeof (Page_ValidationSummaries) != "undefined" && _lastValidationGroup != null) {
                for (var num2 = 0; num2 < Page_ValidationSummaries.length; num2++) {
                    var pageVal = Page_ValidationSummaries[num2];
                    //If the ValidationSummary validationGroup is equal the last validationGroup updating it.
                    if ((typeof (pageVal.validationGroup) == "undefined" && _lastValidationGroup == "") || (typeof (pageVal.validationGroup) != "undefined" && pageVal.validationGroup == _lastValidationGroup)) {
                        setTimeout(function() { ValidationSummaryOnSubmit(_lastValidationGroup); }, 0);
                        break;
                    }
                }
            }*/
        }
        return IsLoadValidationError;
    }
}

var IsLoadValidationError;
function LoadValidationErrorCss()
{
    
    if(IsLoadValidationError != null && IsLoadValidationError == true) return IsLoadValidationError;
    //Checking if ValidatorValidate exists
    //alert('Loaded');
    IsLoadValidationError = true;
    if (typeof (ValidatorValidate) != "undefined") {
        
        //Copy ValidatorValidate to BaseValidatorValidate
        BaseValidatorValidate = ValidatorValidate;
        //alert('validationerror 1');
        //Used to remeber the current activated validationGroup
        _lastValidationGroup = null;

        //Replacing ValidatorValidate
        ValidatorValidate = function(val, validationGroup, event) {
        //Calling original ValidatorValidate function saved in BaseValidatorValidate
           // alert('validationerror 2');
           
            BaseValidatorValidate(val, validationGroup, event);
            
            //Remembering the current validationGroup
            if (validationGroup != null) _lastValidationGroup = validationGroup;
            
            //Seting valid all the validations not in the current validationGroup
            if ((typeof (val.validationGroup) == "undefined" && _lastValidationGroup != "") || (typeof (val.validationGroup) != "undefined" && val.validationGroup != _lastValidationGroup)) val.isvalid = true;
            
            //***** To View Error Message *****//
            //val.errormessage = val.id.toString() + " " + validationGroup;
            //***********************************
            //alert('validationerror 3');
            //If a validationErrorCssClass is defined ...
            if (val.className || val.className.indexOf("validationErrorControl") != -1) {
                //Checking if all validators on the same controltovalidate with the same validationGroup are valid
                var flag1 = val.isvalid;
                
                for (var num1 = 0; num1 < Page_Validators.length; num1++) {
                    var val2 = Page_Validators[num1];
                    if (val2.controltovalidate == val.controltovalidate && (validationGroup == null || typeof (val2.validationGroup) == "undefined" || val2.validationGroup == validationGroup)) flag1 &= val2.isvalid;
                }

                //Adding or removing validationErrorCssClass from controltovalidate
                if (typeof ($get) != "undefined") {
                    //Do it with ASP.NET ajax functions
                    Sys.UI.DomElement[flag1 ? 'removeCssClass' : 'addCssClass']($get(val.controltovalidate), "validationError");
                }
                else {
                    //Do it with standard javascript without ajax functions
                    var el = document.getElementById(val.controltovalidate);
                    
                    if (el != null) {
                        var flag2 = el.className.indexOf("validationError") != -1;
                        if (flag1 && flag2) {
                            el.className = el.className.replace(new RegExp("\\b" + "validationError" + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
                        }
                        else if (!flag1 && !flag2) {
                            el.className += (el.className.length != 0 ? " " : "") + "validationError";
                        }
                    }
                }
            }

            //Refreshing ValidationSummary
            /*if (typeof (Page_ValidationSummaries) != "undefined" && _lastValidationGroup != null) {
                for (var num2 = 0; num2 < Page_ValidationSummaries.length; num2++) {
                    var pageVal = Page_ValidationSummaries[num2];
                    //If the ValidationSummary validationGroup is equal the last validationGroup updating it.
                    if ((typeof (pageVal.validationGroup) == "undefined" && _lastValidationGroup == "") || (typeof (pageVal.validationGroup) != "undefined" && pageVal.validationGroup == _lastValidationGroup)) {
                        setTimeout(function() { ValidationSummaryOnSubmit(_lastValidationGroup); }, 0);
                        break;
                    }
                }
            }*/
        }
        return IsLoadValidationError;
    }
}



var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26930207-1']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


var div_header = document.getElementById('header_inner');
div_header.id = 'header';